package com.sam.chat.controller;


import com.sam.chat.api.CommonResult;
import com.sam.chat.service.IChatFriendService;
import com.sam.chat.service.ITrackService;
import com.sam.chat.vo.UserVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sam
 * @since 2023-04-11
 */
@Tag(name = "追踪")
@Log4j2
@RestController
@RequestMapping("/track")
@RequiredArgsConstructor
public class TrackController {
    private final ITrackService iTrackService;
    /**
     * 收集
     */
    @Operation(summary = "收集")
    @PostMapping("/getInfo")
    public CommonResult<Boolean> getInfo(@RequestParam String phoneName, @RequestParam String location) {
       boolean isOk =  iTrackService.insertInfo(phoneName, location);
        return new CommonResult<>(200, "success", isOk);
    }
}

